import * as types from '../types'


const state = {
//	下单总金额
	allPrice:0,
//	下单总金额-优惠券金额
	allPriceCoupon:0,
//	下单总金额-优惠券id
	couponId:"",
//	下单-入住人
	userCheckInList:0,
//	床位
	bedsList:[],
//	床位id
	bedsId:null,
//	床位编号
	bedsNo:0,
//	短租详情页面传参
	shorthouseinfo :[],
//	短租订单详情
	orderinfodata:[],
//	房客提前退房
	userRefunddata:[],
//	订单支付信息
	AliPayInfodata:[],
//	短租退房详情
	RefundInfodata:[]
}
const actions = {
    setToderInfo({ commit }, res) {
        commit(types.ODER_TODER_INFO, res)
    },
    setRedundInfo({ commit }, res) {
        commit(types.ODER_REDUND_DATA, res)
    },
    setAlipayInfo({ commit }, res) {
        commit(types.ODER_ALIPAY_INFO, res)
    },
    setRefundInfo({ commit }, res) {
        commit(types.ODER_REFUND_INFO, res)
    },
    setAllprice({ commit }, res) {
        commit(types.ODER_ALLPRICE, res)
    },
    setAllPriceCoupon({ commit }, res) {
        commit(types.ODER_ALLPRICE_COUPON, res)
    },
    setuserCheckInList({ commit }, res) {
        commit(types.ODER_USERCHECKINLIST, res)
    },
    setcouponId({ commit }, res) {
        commit(types.ODER_COUPONID, res)
    },
    setbedsList({commit},res){
    	commit(types.ODER_BEDLIST,res);
    },
    setbedsId({commit},res){
    	commit(types.ODER_BEDSLD,res);
    },
    setbedsNo({commit},res){
    	commit(types.ODER_BEDSNO,res);
    },
    setshorhouseinfo({commit},res){
    	console.log("a")
    	commit(types.ODER_SHORHOUSEINFO,res);
    },
    
}
const getters = {
    orderinfodata: state => state.orderinfodata,
    userRefunddata: state => state.userRefunddata,
    AliPayInfodata: state => state.AliPayInfodata,
    RefundInfodata: state => state.RefundInfodata,
    allPrice:state=>state.allPrice,
    allPriceCoupon:state=>state.allPriceCoupon,
    userCheckInList:state=>state.userCheckInList,
    couponId:state=>state.couponId,
    bedsList:state=>state.bedsList,
    bedsId:state=>state.bedsId,
    bedsNo:state=>state.bedsNo,
    shorthouseinfo:state=>state.shorthouseinfo ,
}


const mutations = {
    [types.ODER_TODER_INFO](state, res) {
        state.orderinfodata = res
    },
    [types.ODER_REDUND_DATA](state, res) {
        state.userRefunddata = res
    },
    [types.ODER_ALIPAY_INFO](state, res) {
        state.AliPayInfodata = res
    },
    [types.ODER_REFUND_INFO](state, res) {
        state.RefundInfodata = res
    },
    [types.ODER_ALLPRICE](state, res) {
        state.allPrice = res
    },
    [types.ODER_ALLPRICE_COUPON](state, res) {
        state.allPriceCoupon = res
    },
    [types.ODER_USERCHECKINLIST](state, res) {
        state.userCheckInList = res
    },
    [types.ODER_COUPONID](state, res) {
        state.couponId = res
    },
    [types.ODER_BEDLIST](state, res) {
        state.bedsList = res
    },
    [types.ODER_BEDSLD](state, res) {
        state.bedsId = res
    },
    [types.ODER_BEDSNO](state, res) {
        state.bedsNo = res
    },
    [types.ODER_SHORHOUSEINFO](state, res) {
        state.shorthouseinfo = res
    },
}
export default {
    state,
    actions,
    getters,
    mutations,
}